package com.intel.core 
{
	import com.intel.utils.Debugger;
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.geom.Point;
	
	/**
	 * ...
	 * @author Fintan Boyle
	 */
	public class Application extends MovieClip
	{
		public static const VERSION:String = "1.0.0.1";
		//a flag for setting dummy data as a fall back
		public static var PREVIEW_IN_IDE:Boolean = true;
		
		public static var stage:Stage;
		public static var root:Sprite;
		public static var applicationWidth:Number;
		public static var applicationHeight:Number;
		
		public function Application() 
		{
			//if caters for possible Preloader and/or Main document class
			if (!Application.stage) {
				Application.stage = this.stage;
				Application.root = this;
				Debugger.setRoot(Application.root);
			}
		}
		
		public static function getOrigin():Point 
		{
			var px:Number = 0,  py:Number=0;
			
			//getFullscreenNoScaleOrigin
			if (stage.align == StageAlign.TOP && stage.scaleMode == StageScaleMode.NO_SCALE){
				px = (stage.fullScreenWidth - applicationWidth) / 2;
				py = (stage.stageHeight - applicationHeight) / 2;
			}
			
			return new Point(px, py);
		}
		
	}
	
}